/*
	需求：吸顶菜单
* 滚动滑轮，获取滚动距离
* 如果超过了临界值，就给菜单添加fixed，吸在顶部
*/
var oUl1 = document.getElementById("ul1");
var oUl2 = document.getElementById("ul2");
var oUl2_Top = oUl2.offsetTop; //获取临界值
window.onscroll = function () {
  //var scrollTop = window.scrollY;//滚动滑轮，获取滚动距离
  var scrollTop = document.documentElement.scrollTop || document.body.scrollTop;
  if (scrollTop >= oUl2_Top) {
    oUl2.className = 'fix'; // 到达临界点了;
  } else {
    oUl2.className = '';
  }
}